package com.wpw.dream.single;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SingleThreadPool {
	
	private static ExecutorService threadPool;
	
	private SingleThreadPool() {
		super();
	}
	
	public static ExecutorService  getThreadPool() {
		if (threadPool == null) {
			synchronized (SingleThreadPool.class) {
				if (threadPool == null) {
					threadPool = Executors.newFixedThreadPool(5);
				}
			}
		}
		return threadPool;
	}

}
